CC	=	g++

CFLAGS	= -g -O0 `sdl-config --cflags`

LIBS	=	-lOpenNI 	\
		-lXnVNite 	\
		-lGL 		\
		-lGLU 		\
		-lglut		\
		-lboost_thread	\
		-lboost_filesystem	\
		-lboost_serialization	\
		-lltdl\
		`sdl-config --libs` -lSDL_image -lSDL_ttf	

INCLUDE_PATH =	-I/usr/include/nite/	\
		-I/usr/include/ni/	\
		-I../Apps/

PREBUILD = glutEngine.o graphicEngine.o \
		App.o AppList.o \
		System.o User.o SystemPreferences.o UserPreferences.o

TOBUILD = main.o AppLoader.o EventDispatcher.o

DEPEND = $(addprefix $(BUILDDIR),$(PREBUILD)) 	\
	 $(addprefix $(BUILDDIR),$(TOBUILD))

EXEC	= ../../KiCTRL

BUILDDIR = ../build/

DEFINE	= -DDEBUG

all:$(EXEC)

$(EXEC): $(DEPEND)
	$(CC) -o $@ $^ $(DEFINE) $(LIBS) $(CFLAGS)

$(BUILDDIR)%.o:%.cpp
	$(CC) -o $@ -c $< $(DEFINE) $(INCLUDE_PATH) $(CFLAGS)

clean:
	rm -rf $(DEPEND) $(EXEC)